#:kivy 1.0
#:import kivy kivy

<NotificationArea>:
    notifications: notifications
    clock: clock
    orientation: 'horizontal'
    size_hint: 1, None
    height: 90
    Label:
        id: notifications
        halign: 'left'
        valign: 'top'
        text_size: None, self.size[1] 
        size: self.texture_size
    AnchorLayout:
        anchor_x: 'right'
        anchor_y: 'top'
        Label:
            id: clock
            text_size: self.size
            font_size: 80
            color: (1, 1, 1, 1)
            text: '11:05'
            font_name: 'DS-DIGIB.TTF'
            halign: 'right'

<ControlButton>:
    font_size: 15
    background_normal: 'black.png'
    background_down: 'blue.png'


<NewsEntry>:
    #background_color: 0.5,0.5,0.5,0.3
    background_normal: 'buttona.png'
    background_down: 'section.png'
    font_size: 9

<NewsItem>:
    canvas:
        Color:
            rgba: 0.2,0.2,0.2,0.3
        Rectangle:
            size: self.size 
            pos: self.pos  
    title: title
    summary: summary
    icon: icon
    orientation: 'horizontal'
    padding: 10
    
    BoxLayout:
        orientation: 'vertical'
        spacing: 10
        padding: 10
        Label:
            id: title
            halign: 'left'
            font_size: 18
            text_size: self.size[0], None 
            valign: 'top'
            size_hint: 1, 0.3
        Label:
            id: summary
            halign: 'left'
            valign: 'middle'
            text_size: self.size[0], None 
            size: self.texture_size
            canvas:
                Color:
                    rgba: 0.2,0.2,0.2,0.5
                Rectangle:
                    size: self.texture_size[0]+10, self.texture_size[1]+10
                    pos: self.pos[0]-10,  self.pos[1]-5
    BoxLayout:
        id: icon
        size_hint: None, 1
        size: self.size[1], self.size[1]

<Main>:
    newscontent: newscontent
    news: news
    weather: weather
    spacing: 5
    orientation: 'vertical'
    BoxLayout:
        #id: newscontent
        orientation: 'vertical'
        #spacing: 5
        #valign: 'top'
        BoxLayout:
            id: newscontent
        GridLayout:
            cols: 2
            spacing: 5
            id: news
            size_hint: 1, 0.5
    BoxLayout:
        id: weather
        orientation: 'horizontal'
        spacing: 5
        size_hint: 1, 0.5

<Light>:
    name: name
    icon: icon
    orientation: 'vertical'
    height: 135
    width: 75
    size_hint: None, None
    Label:
        id: name
        valign: 'bottom'
        halign: 'left'
        font_size: 12
        height: 15
        size_hint: 1, None
    ToggleButton:
        id: icon
        background_normal: 'lightOffSmall.png'
        background_down: 'lightOnSmall.png'
        height: root.size[1]-15
        width: root.size[0]
        size_hint: None, None


<LightsSection>:
    name: name
    grid: grid
    orientation: 'vertical'
    spacing: 10
    Label:
        id: name
        text: root.label
        valign: 'top'
        halign: 'left'
        font_size: 18
        height: 15
        size_hint: 1, None
    GridLayout:
        id: grid
        rows: 1
        spacing: 40
        padding: 0
        height: root.size[1]-15
        width: root.size[0]
        size_hint: None, None

                        
<Lights>:
    globals: globals
    groups: groups
    individuals: individuals
    orientation: 'vertical'
    padding: 10
    GridLayout:
        rows: 3
        cols: 1
        spacing: 10
        LightsSection:
            id: globals
            label: 'Global'
        LightsSection:
            id: groups
            label: 'Groups'
        LightsSection:
            id: individuals
            label: 'Individual'

       
<Section>:
    header: header
    temperature: temperature
    feels: feels
    icon: icon
    description: description
    canvas:
        Color:
            rgba: 0.2,0.2,0.2,0.3
        Rectangle:
            size: self.size 
            pos: self.pos  
    orientation: 'vertical'
    padding: 10
    spacing: 10
    Label:
        id: header
        size_hint: 1, None
        height: 15
        font_size: 15
        valign: 'top'
    BoxLayout:
        size_hint: 1, 1
        orientation: 'horizontal'
        BoxLayout:
            orientation: 'vertical'
            padding: 10
            spacing: 30
            Label:
                id: temperature
                font_size: 25
            Label:
                id: feels
                #font_size: 15
                color: (0.3, 0.3, 1, 1)
        AsyncImage:
            id: icon
    Label:  
        id: description
    #Label:  
    #    text: 'Dew point: 64\nHumidity: 69%'
                                    
<TouchUI>:
    notification: notification
    clock: notification.clock
    buttons: buttons
    content: content
    canvas:
        Color:
            rgb: 1, 1, 1
        Rectangle:
            source: 'data/images/background.jpg'
            size: self.size

    BoxLayout:
        orientation: 'vertical'
        padding: 10
        spacing: 10
        NotificationArea:
            id: notification
        GridLayout:
            id: grid
            cols: 2
            spacing: 5
            BoxLayout:
                id: buttons
                orientation: 'vertical'
                size_hint: 0.15, 1
                spacing: 10
            BoxLayout:
                id: content
                orientation: 'vertical'
                size_hint: 0.85, 1


